package com.solution.pc.order.entity;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.solution.common.entity.BaseEntity;
import com.solution.common.utils.DateUtils;

/**
 * 订单商品评价实体类
 * @author xkl
 * @date 2017-11-28 11:42:28
 */
public class OrderEvaluationEntity extends BaseEntity {
	private static final long serialVersionUID = -3926291988306842687L;
	
	/**
	 * 订单ID
	 */
	private Long orderId;
	/**
	 * 订单编码
	 */
	private String orderCode;
	
	/**
	 * 商品编码
	 */
 	private String productCode;
	
	/**
	 * 商品名称
	 */
	private String productName;
	
	/**
	 * 商品图片
	 */
	private String imagePath;
	
	/**
	 * 评价星级
	 */
 	private Integer score;
	
	/**
	 * 内容
	 */
	private String content;
	
	/**
	 * 评论图片路径
	 */
	private String filePath;
	
	/**
	 * 评论用户ID
	 */
 	private Long userId;
	
	/**
	 * 评论用户名
	 */
	private String userName;
	
	/**
	 * 用户头像
	 */
	private String headImage;
	
	/**
	 * 用户级别名称
	 */
	private String levelName;
	
	/**
	 * 来源标记(1.PC 2.微信)
	 */
	private String channel;
	
	/**
	 * group_concat字段-订单评价集合
	 */
	private String evaluationDetail;
	/**
	 * 额外字段-商品图片
	 */
	private String productImg;
	

	public Long getOrderId() {
		return orderId;
	}
	public void setOrderId(Long orderId) {
		this.orderId = orderId;
	}
	/**
	 * 订单ID
	 */
	public String getOrderCode() {
		return orderCode;
	}
	public void setOrderCode(String orderCode) {
		this.orderCode=orderCode;
	}
	/**
	 * 商品ID
	 */
 	public String getProductCode() {
		return productCode;
	}
	public void setProductCode(String productCode) {
		this.productCode=productCode;
	}

	/**
	 * 商品名称
	 */
	public String getProductName() {
		return productName;
	}
	public void setProductName(String productName) {
		this.productName=productName;
	}

	public String getImagePath() {
		return imagePath;
	}
	public void setImagePath(String imagePath) {
		this.imagePath = imagePath;
	}
	/**
	 * 评价星级
	 */
 	public Integer getScore() {
		return score;
	}
	public void setScore(Integer score) {
		this.score=score;
	}

	/**
	 * 内容
	 */
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content=content;
	}

	/**
	 * 评论图片路径
	 */
	public String getFilePath() {
		return filePath;
	}
	public void setFilePath(String filePath) {
		this.filePath=filePath;
	}
	public List<String> getFilePathList() {
		List<String> filePathList = new ArrayList<String>();
		if (null != this.filePath && !this.filePath.equals("")) {
			filePathList = Arrays.asList(filePath.split(","));
		}
		return filePathList;
	}

	/**
	 * 评论用户ID
	 */
 	public Long getUserId() {
		return userId;
	}
	public void setUserId(Long userId) {
		this.userId=userId;
	}

	/**
	 * 评论用户名
	 */
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName=userName;
	}

	/**
	 * 用户头像
	 */
	public String getHeadImage() {
		return headImage;
	}
	public void setHeadImage(String headImage) {
		this.headImage=headImage;
	}

	/**
	 * 用户级别名称
	 */
	public String getLevelName() {
		return levelName;
	}
	public void setLevelName(String levelName) {
		this.levelName=levelName;
	}
	
	public String getChannel() {
		return channel;
	}
	public void setChannel(String channel) {
		this.channel = channel;
	}
	public String getCreateTimeStr() {
		if (null != getCreateTime()) {
			return DateUtils.formatDateTime(getCreateTime());
		}
		return "";
	}
	
	public String getEvaluationDetail() {
		return evaluationDetail;
	}
	public void setEvaluationDetail(String evaluationDetail) {
		this.evaluationDetail = evaluationDetail;
	}
	public JSONArray getEvaluationDetailArray() {
		JSONArray detailJson = new JSONArray();
		if (evaluationDetail != null) {
			detailJson = JSON.parseArray("["+evaluationDetail+"]");
		}
		return detailJson;
	}
	public String getProductImg() {
		return productImg;
	}
	public void setProductImg(String productImg) {
		this.productImg = productImg;
	}
}
